package com.financing.wap.service.impl;


import java.sql.SQLException;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import com.financing.wap.dto.FpShopActivityUserDTO;
import com.financing.wap.service.IFpShopActivityUserService;
import com.financing.wap.dao.IFpShopActivityUserDao;
/**
 * fp_shop_activity_user  
 *  业务访问层实现类
 * @author huqiyun
 *
 */
 
@Repository("fpShopActivityUserService")
public class FpShopActivityUserServiceImpl implements IFpShopActivityUserService{

	@Autowired
	private IFpShopActivityUserDao fpShopActivityUserDao;

	@Override
	public int insert(FpShopActivityUserDTO fpShopActivityUser) throws SQLException {
//		DTOdateSetUtil.setCreateInfo(fpShopActivityUser);
//		DTOdateSetUtil.setUpdateInfo(fpShopActivityUser);
//		fpShopActivityUser.setDeleteTag(CommonStatus.DELETE_TAG_NORMAL);
		return fpShopActivityUserDao.insert(fpShopActivityUser);
	}

	@Override
	public void update(FpShopActivityUserDTO fpShopActivityUser) throws SQLException {
//		DTOdateSetUtil.setUpdateInfo(fpShopActivityUser);
		fpShopActivityUserDao.update(fpShopActivityUser);
	}

	@Override
	public void updateForce(FpShopActivityUserDTO fpShopActivityUser) throws SQLException {
//		DTOdateSetUtil.setUpdateInfo(fpShopActivityUser);
		fpShopActivityUserDao.updateForce(fpShopActivityUser);
	}

	@Override
	public void delete(Integer id) throws SQLException {
		fpShopActivityUserDao.delete(id);
	}
	
	@Override
	public List<FpShopActivityUserDTO> queryList(FpShopActivityUserDTO fpShopActivityUser) throws SQLException {
		return fpShopActivityUserDao.queryList(fpShopActivityUser);
	}

	@Override
	public int queryListCount(FpShopActivityUserDTO fpShopActivityUser) throws SQLException {
		return fpShopActivityUserDao.queryListCount(fpShopActivityUser);
	}

	@Override
	public FpShopActivityUserDTO loadById(Integer id) throws SQLException {
		return fpShopActivityUserDao.loadById(id);
	}
 	@Override
	public FpShopActivityUserDTO queryListGetFirst(FpShopActivityUserDTO fpShopActivityUser)
			throws SQLException {
		 List<FpShopActivityUserDTO> queryList = queryList(fpShopActivityUser);
		 if(queryList==null||queryList.size()==0){
			 return new FpShopActivityUserDTO();
		 }
		 return queryList.get(0);
	}
}
